# -*- coding: utf-8 -*-
# @Time    : 2020/1/13 23:11
# @Author  : Weymouth
# @Email   : 261229090@qq.com
# @File    : 函数参数.py
# @Software: PyCharm
# ---------------------------------------------------

# def print_info(name, age):
#     print('Name：%s' % name)
#     print('Age：%s' % age)
#
#
# print_info('UZI', 38)   #必须参数
# print_info(name='abc', age=19)  #关键字参数

# 默认参数
# def print_info(name, age, sex='male'):
#     print('Name：%s' % name)
#     print('Age：%s' % age)
#     print('Sex：%s' % sex)


# print_info('abc', 28)
# print_info('jin', 43)
# print_info('mk', 13)

# def add(*args): #不定长参数
#     print(args)
#     sum=0
#     for i in args:
#         sum+=i
#     print(sum)
# add(1,2,3,4,5)

def print_info(*args, **kwargs):
    # print(args)
    print(kwargs)
    for i in kwargs:
        print('%s：%s' % (i, kwargs[i]))


print_info('abcd', 18, 'male', job='IT', hobby='girls', height=188)
